package com.ruoyi.bantong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bantong.mapper.BtSlideshowMapper;
import com.ruoyi.bantong.domain.BtSlideshow;
import com.ruoyi.bantong.service.IBtSlideshowService;

/**
 * 轮播图Service业务层处理
 * 
 * @author laohei
 * @date 2021-01-24
 */
@Service
public class BtSlideshowServiceImpl implements IBtSlideshowService 
{
    @Autowired
    private BtSlideshowMapper btSlideshowMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图ID
     * @return 轮播图
     */
    @Override
    public BtSlideshow selectBtSlideshowById(Integer id)
    {
        return btSlideshowMapper.selectBtSlideshowById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param btSlideshow 轮播图
     * @return 轮播图
     */
    @Override
    public List<BtSlideshow> selectBtSlideshowList(BtSlideshow btSlideshow)
    {
        return btSlideshowMapper.selectBtSlideshowList(btSlideshow);
    }

    /**
     * 新增轮播图
     * 
     * @param btSlideshow 轮播图
     * @return 结果
     */
    @Override
    public int insertBtSlideshow(BtSlideshow btSlideshow)
    {
        btSlideshow.setCreateTime(DateUtils.getNowDate());
        return btSlideshowMapper.insertBtSlideshow(btSlideshow);
    }

    /**
     * 修改轮播图
     * 
     * @param btSlideshow 轮播图
     * @return 结果
     */
    @Override
    public int updateBtSlideshow(BtSlideshow btSlideshow)
    {
        btSlideshow.setUpdateTime(DateUtils.getNowDate());
        return btSlideshowMapper.updateBtSlideshow(btSlideshow);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图ID
     * @return 结果
     */
    @Override
    public int deleteBtSlideshowByIds(Integer[] ids)
    {
        return btSlideshowMapper.deleteBtSlideshowByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图ID
     * @return 结果
     */
    @Override
    public int deleteBtSlideshowById(Integer id)
    {
        return btSlideshowMapper.deleteBtSlideshowById(id);
    }
}
